package com.jucai.pppeiyouclient.view.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.jucai.pppeiyouclient.MainActivity;
import com.jucai.pppeiyouclient.R;
import com.jucai.pppeiyouclient.base.BaseActivity;
import com.jucai.pppeiyouclient.utils.ActivityCollector;



public class RegisterInfoReviewingActivity extends BaseActivity {
    private TextView reviewSure, reviewConsummate;

    @Override
    protected void initView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_register_info_reviewing);

        ((TextView) findViewById(R.id.common_title_text)).setText("审核中");

        reviewSure = (TextView) findViewById(R.id.review_sure);
        reviewConsummate = (TextView) findViewById(R.id.review_consummate);
        reviewConsummate.setVisibility(View.GONE);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void loadNetData() {

    }

    @Override
    protected void setListener() {
        findViewById(R.id.common_back).setOnClickListener(this);
        findViewById(R.id.common_home_back).setOnClickListener(this);
        reviewSure.setOnClickListener(this);
        reviewConsummate.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.common_back:
                ActivityCollector.removeActivity(this);
                break;

            case R.id.common_home_back:
                startActivity(new Intent(RegisterInfoReviewingActivity.this, MainActivity.class));
                ActivityCollector.removeActivity(this);
                break;

            case R.id.review_sure:

               /* HashMap<String, String> param = new HashMap<>();
                param.put("service", "Accompany_Login.go");
                param.put("member_phone", SharedPreferencesUtil.getStringPreference(RegisterInfoReviewingActivity.this, "PREFERENCE", "phone", ""));
                param.put("password", SharedPreferencesUtil.getStringPreference(RegisterInfoReviewingActivity.this, "PREFERENCE", "password", ""));

                CommonRequestNetData.getJsonObjectData(RegisterInfoReviewingActivity.this, param, true, new CommonRequestNetData.JsonObjectCallBack() {
                    @Override
                    public void parseJsonObject(JSONObject jsonObject) {
                        try {
                            String token = jsonObject.getString("token");
                            String memberId = jsonObject.getString("member_id");
                            String rongyun_token = jsonObject.has("rongyun_token") ? jsonObject.getString("rongyun_token") : "";
                            CommonData.saveLoginData(RegisterInfoReviewingActivity.this, memberId, SharedPreferencesUtil.getStringPreference(RegisterInfoReviewingActivity.this, "PREFERENCE", "password", ""), token, rongyun_token);
                            startActivity(new Intent(RegisterInfoReviewingActivity.this, MySkillsActivity.class));
                            ActivityCollector.removeActivity(RegisterInfoReviewingActivity.this);
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                    }
                });*/
                startActivity(new Intent(RegisterInfoReviewingActivity.this, MainActivity.class));
                ActivityCollector.removeActivity(this);

                break;

            case R.id.review_consummate:
                break;
        }
    }
}
